package com.shj.service.impl;

import com.shj.dao.SysPartMapper;
import com.shj.entity.SysPart;
import com.shj.service.SysPartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author songhuajian
 * @Description: TODO
 * @date 2020/6/16 14:04
 **/
@Service
public class SysPartServiceImpl implements SysPartService {

    @Autowired
    private SysPartMapper sysPartMapper;

    @Override
    public List<SysPart> findAll() {
        return sysPartMapper.findAll();
    }

    @Override
    public SysPart findById(Integer id) {
        return sysPartMapper.selectById(id);
    }

    @Override
    public SysPart findByYear(String year) {
        return sysPartMapper.findByYear(year);
    }

    @Override
    public void add(SysPart sysPart) {
        sysPartMapper.insert(sysPart);
    }

    @Override
    public void edit(SysPart sysPart) {
        sysPartMapper.updateByPrimaryKey(sysPart);
    }

    @Override
    public void delete(Integer id) {
        sysPartMapper.deleteByPrimaryKey(id);
    }
}
